package org.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class FirstController {

    @GetMapping("/first")
    public ModelAndView getView(@RequestParam("name") String name){
      ModelAndView mv = new ModelAndView("first");  //first.html
      mv.addObject("name",name); //传值
      return mv;
    }
}
